<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
</head>
<body>
<div th:fragment="header" class="navigation-wrap bg-light start-header start-style">
    <div class="container" >
        <div class="row">
            <div class="col-12">
                <nav class="navbar navbar-expand-md navbar-light">

                    <a class="navbar-brand" th:href="@{/index}" ><img th:src="@{/images/logo.png}" alt=""></a>

                    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                        <span class="navbar-toggler-icon"></span>
                    </button>

                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <ul class="navbar-nav ml-auto py-4 py-md-0">
                            <li class="nav-item pl-4 pl-md-0 ml-0 ml-md-4 active">
                                <a class="nav-link" th:href="@{/index}">首页</a>
                            </li>
                            <li class="nav-item pl-4 pl-md-0 ml-0 ml-md-4">
                                <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">转化</a>
                                <div class="dropdown-menu">
                                    <a class="dropdown-item" th:href="@{/convert/xmltojson}">XML to JSON</a>
                                    <a class="dropdown-item" th:href="@{/convert/xmltocsv}">XML to CSV</a>
                                    <a class="dropdown-item" th:href="@{/convert/xmltoyaml}">XML to YAML</a>
                                    <a class="dropdown-item" th:href="@{/convert/jsontoxml}">JSON to XML</a>
                                    <a class="dropdown-item" th:href="@{/convert/jsontocsv}">JSON to CSV</a>
                                    <a class="dropdown-item" th:href="@{/convert/jsontoyaml}">JSON to YAML</a>
                                    <a class="dropdown-item" th:href="@{/convert/csvtoxml}">CSV to XML</a>
                                    <a class="dropdown-item" th:href="@{/convert/csvtojson}">CSV to JSON</a>
                                    <a class="dropdown-item" th:href="@{/convert/csvtoyaml}">CSV to YAML</a>
                                    <a class="dropdown-item" th:href="@{/convert/yamltoxml}">YAML to XML</a>
                                    <a class="dropdown-item" th:href="@{/convert/yamltojson}">YAML to JSON</a>
                                    <a class="dropdown-item" th:href="@{/convert/yamltocsv}">YAML to CSV</a>
                                    <div th:each="convertTypeList : ${convertTypeList}">
                                        <!-- 在这里添加你想要循环的内容 -->
                                        <a class="dropdown-item" th:href="@{'/convert/' + ${convertTypeList[0]} + 'to' + ${convertTypeList[1]}}" th:text="${convertTypeList[0]}+' to '+${convertTypeList[1]}" ></a>
                                    </div>

                                </div>
                            </li>
<!--                            <li class="nav-item pl-4 pl-md-0 ml-0 ml-md-4">-->
<!--                                <a class="nav-link" th:href="@{/savefile}">Upload file</a>-->
<!--                            </li>-->
                            <li class="nav-item pl-4 pl-md-0 ml-0 ml-md-4">
                                <a class="nav-link dropdown-toggle" data-toggle="dropdown" th:href="@{/formatting}" role="button" aria-haspopup="true" aria-expanded="false">格式化</a>
                                <div class="dropdown-menu">
                                    <a class="dropdown-item" th:href="@{/formatting}">XML Formatter</a>
                                    <a class="dropdown-item" th:href="@{/formatting}">Json Formatter</a>
                                </div>
                            </li>
                            <li class="nav-item pl-4 pl-md-0 ml-0 ml-md-4">
                                <a class="nav-link" th:href="@{/filemanage}">文件管理</a>
                            </li>
                            <li class="nav-item pl-4 pl-md-0 ml-0 ml-md-4">
                                <a class="nav-link" th:href="@{/pluginmanage}">插件管理</a>
                            </li>
                            <li th:if="${user != null}" class="nav-item pl-4 pl-md-0 ml-0 ml-md-4" id="user-box">
<!--                                <img class="icon-head" th:src="@{'/avatars/'+ ${user?.avatar}}" alt="头像" >-->
                                <img class="icon-head" th:src="@{'/avatars/'+ ${user?.avatar}}" alt="头像" >
                                <a class="nav-link dropdown-toggle" data-toggle="dropdown" id="user" href="#" th:text="${user?.username}"role="button" aria-haspopup="true" aria-expanded="false"></a>
                                <div class="dropdown-menu">
                                    <a class="dropdown-item" th:href="@{/home}">个人中心</a>
<!--                                    <a class="dropdown-item" th:href="@{/account/changePassword}">Change Password</a>-->
                                    <a class="dropdown-item" th:href="@{/logout}">退出登录</a>

                                </div>
                            </li>
                            <li th:unless="${user != null}" class="nav-item pl-4 pl-md-0 ml-0 ml-md-4" id="login-box">
                                <a class="nav-link" th:href="@{/login}">Login/Register</a>
                            </li>
                        </ul>
                    </div>

                </nav>

            </div>

        </div>

    </div>

</div>

</body>
</html>